package com.aaa.controller;

import com.aaa.entity.Singer;
import com.aaa.entity.Song;
import com.aaa.service.SingerService;
import com.aaa.service.SongService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("song")
public class SongController {
    @Resource
    SongService songService;
    @RequestMapping("selectAll")
    @ResponseBody
    public List<Song> select(){
        return songService.selectAll();
    }
    @RequestMapping("select")
    @ResponseBody
    public List<Song> select(String name){
        return songService.select(name);
    }
    @RequestMapping("add")
    @ResponseBody
    public Integer add(Song song){
        return songService.add(song);
    }
    @RequestMapping("update")
    @ResponseBody
    public Integer update(Song song){
        return songService.update(song);
    }
    @RequestMapping("delete")
    @ResponseBody
    public Integer delete(Integer id){
        return songService.delete(id);
    }
}
